<template>
  <div>
    <router-view></router-view>
  <van-tabbar v-model="active"> 
  <van-tabbar-item @click="onChange" name="home" icon="home-o">首页</van-tabbar-item>
  <van-tabbar-item @click="change('fenlei')" name="search" icon="apps-o">分类</van-tabbar-item>
  <van-tabbar-item @click="change('gouwu')" name="friends" icon="shopping-cart-o">购物车</van-tabbar-item>
  <van-tabbar-item @click="change('wode')" name="setting" icon="friends-o">我的</van-tabbar-item>
</van-tabbar>
</div>
</template>

<script>
export default {
    created(){
        this.onChange()
    },
 data() {
    return {
      active: 'home',
    };
  },
  methods:{
      onChange(path){
      this.$router.push("/index/shouye")
      },
      change(path){
      this.$router.push("/index/"+path)

      }
  }
}
</script>

<style>

</style>